package com.itheima.health.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.health.mapper.CheckGroupMapper;
import com.itheima.health.pojo.CheckGroup;
import com.itheima.health.service.CheckGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author kcs
 * @date 2021/11/23
 * @TIME:0:00
 */
@Service
public class CheckGroupServiceImpl extends ServiceImpl<CheckGroupMapper, CheckGroup> implements CheckGroupService {

    @Autowired
    private CheckGroupMapper checkGroupMapper;

    //获取该id对应检查组包含的多个检查项ID
    @Override
    public int[] findCheckItemIdsByCheckGroupId(Integer id) {
        return checkGroupMapper.findCheckItemIdsByCheckGroupId(id);
    }

    //添加检查组对应检查项到关系表
    @Override
    public void add(Integer checkitemId,Integer checkGroupId) {
        checkGroupMapper.add(checkitemId,checkGroupId);
    }

    //在关系表中删除该检查组和对应检查项的关系数据
    @Override
    public void delete(Integer checkGroupId) {
        checkGroupMapper.delete(checkGroupId);
    }
}
